A magnetic field can form if there is liquid metal in a planet's core. The liquid metal conducts electricity. As the planet rotates, the liquid moves. This generates an electric current. The electric current produces a magnetic field. Mercury was thought to have a solid core. Without a moving liquid in the core, there usually won't be a magnetic field. Several theories try to explain the presence of a magnetic field. The outer edge of Mercury's core may be partly liquid. The planet rotates so slowly that the liquid wouldn't swirl much. This would produce only a weak magnetic field.